#ifndef KPARENGINE_H
#define KPARENGINE_H

#include "kpar2customevents.h"
#include <string>
#include <qobject.h>
#include <kpar.h>

class ParHeaders;
class Par2Repairer;
class CommandLine;

class KparEngine: public QObject
{
     Q_OBJECT

public:

    KparEngine(Kpar* gui);
    ~KparEngine();
    Kpar* kpar_gui;
    Par2Repairer *par2repairer;
    CommandLine *cmdline;
    Operation operation;
    bool to_be_repaired;
    int total_files;
    int processed_files;
    int files_damaged;
    int files_missing;

public:
    bool loadPAR2Files( const QString& par2file );
    bool checkParity( const QString& par2file );
    bool repairFiles( const QString& par2file );

private slots:
    void signal_filename( std::string str );
    void signal_progress( double value );
    void signal_headers( ParHeaders* headers );
    void signal_done( std::string filename, int blocks_available, int blocks_total );
};

#endif // KPARENGINE_H
